using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_ItemPropdescAccessMap : EntityTypeConfiguration<t_ItemPropdescAccess>
    {
        public t_ItemPropdescAccessMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FItemClassID, t.FSQLColumnName });

            // Properties
            this.Property(t => t.FItemClassID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FName_Cht)
                .HasMaxLength(255);

            this.Property(t => t.FName_en)
                .HasMaxLength(255);

            this.Property(t => t.FSQLColumnName)
                .IsRequired()
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("t_ItemPropdescAccess");
            this.Property(t => t.FItemClassID).HasColumnName("FItemClassID");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FName_Cht).HasColumnName("FName_Cht");
            this.Property(t => t.FName_en).HasColumnName("FName_en");
            this.Property(t => t.FSQLColumnName).HasColumnName("FSQLColumnName");
            this.Property(t => t.FViewMask).HasColumnName("FViewMask");
        }
    }
}
